﻿namespace LinkedTU.Models
{
    using LinkedTU.Common.Constants;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;

    public class Project : BaseDbEntity
    {
        private ICollection<ProfileInfo> teamMembers;

        public Project()
        {
            this.teamMembers = new HashSet<ProfileInfo>();
        }

        public int ProjectId { get; set; }

        [Required]
        [MinLength(ValidationConstants.MinProjectNameLength)]
        [MaxLength(ValidationConstants.MaxProjectNameLength)]
        public string Name { get; set; }

        [MinLength(ValidationConstants.MinProjectDescriptionLength)]
        [MaxLength(ValidationConstants.MaxProjectDescriptionLength)]
        public string Description { get; set; }

        [MaxLength(ValidationConstants.MaxUrlLength)]
        [DataType(DataType.Url)]
        public string Url { get; set; }

        public int Order { get; set; }

        public virtual ICollection<ProfileInfo> TeamMembers
        {
            get { return this.teamMembers; }
            set { this.teamMembers = value; }
        }
    }
}
